home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / pas_all.zip / TI341.ASC < prev    next >
Text File  |  1991-09-11  |  854b  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.   PRODUCT : TURBO PASCAL                               NUMBER : 341
  10.   VERSION : 2.0xx
  11.        OS : 16-Bit
  12.      DATE : October 9, 1986                              PAGE : 1/1
  13.     TITLE : RELEASE PROCEDURE UPDATET
  14.  
  15.  
  16.  
  17.  
  18.   This procedure is a  work-around  for a problem in version 2.0 of
  19.   Turbo  Pascal  that  does not correctly release space on the heap
  20.   when  a  pointer  is  allocated  with  New  and deallocated  with
  21.   Release.
  22.  
  23.   The following routine should be called instead of Release to free
  24.   space on the heap.
  25.  
  26.   type
  27.     IntPtr = ^integer;
  28.  
  29.   procedure ReleaseHeap(OldHeapPtr : IntPtr);
  30.  
  31.   begin
  32.     FreeMem(OldHeapPtr, ((Seg(HeapPtr^) - Seg(OldHeapPtr^)) shl 4) +
  33.             (Ofs(HeapPtr^) - Ofs(OldHeapPtr^)));
  34.   end; { ReleaseHeap }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.